package d6_byte_stream;

import java.io.*;

/**
 * 2024/6/14 Cjj 掌握文件字节输出流1FileOutputStream使用  8:46
 */
public class FileOutputStreamTest4 {
    public static void main(String[] args) throws IOException {
        //1.创建一个文件字节输出流管道与目标文件接通
        OutputStream stream = new FileOutputStream("file-io/src/main/test/out.txt");

        //2.开始写字节数据
        stream.write(97);
        stream.write('d');

        byte[] bytes = "我爱你中国abc".getBytes();
       stream.write(bytes);

       stream.write(bytes,0,15);
       stream.close();
    }
}
